﻿Type=Activity
Version=6
ModulesStructureVersion=1
B4A=true
@EndOfDesignText@
#Region  Activity Attributes 
	#FullScreen: False
	#IncludeTitle: True
#End Region

Sub Process_Globals
	'These global variables will be declared once when the application starts.
	'These variables can be accessed from all modules.

End Sub

Sub Globals
	'These global variables will be redeclared each time the activity is created.
	'These variables can only be accessed from this module.

	Private btnleft As Label
	Private lbltitle As Label
	Private clv As clsCustomListView
	Private itemname As Label
	Private itemvalue As Label
	Private ivrightarr As ImageView
	Dim xtgglst As List
End Sub

Sub Activity_Create(FirstTime As Boolean)
	'Do not forget to load the layout file created with the visual designer. For example:
	Dim telaw As telanywhere
	telaw.Initialize(Activity)
	Activity.LoadLayout("layheaderwithclv")
	comm.setFA(btnleft,"fa-angle-left","")
	lbltitle.Text="公告列表"
	Dim nh As Int=53dip,tht As Int
	xtgglst=g_store.get("xtgg")
	If xtgglst<>Null And xtgglst.Size>0 Then
		Dim nw As Int=100%x,nh As Int=nh
		For i=0 To xtgglst.Size-1
			Dim mxtgg As Map=xtgglst.Get(i)
			clv.Add(CreateItemxtgg(mxtgg.GetDefault("title",""),"",nw,nh,True),nh,i)
'			If i=2 Then Exit
		Next
'		clv.Add(CreateItemxtgg("查看更多","",nw,nh,True),nh,-99)
	End If
	
End Sub
Private Sub CreateItemxtgg(str As String,val As String,w As Int,h As Int,hasArr As Boolean) As Panel
	Dim p As Panel
	p.Initialize("")
	Activity.AddView(p,0,0,w,h)
	p.LoadLayout("itemxtgg")
	ivrightarr.Visible=hasArr
	p.RemoveView
	itemname.Text=str
	itemname.TextColor=Colors.Red
	Return p
End Sub
Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub


Sub ivback_Click
	Activity.Finish
End Sub

Sub clv_ItemClick (Index As Int, Value As Object)
	Dim idx As Int=Value
	Dim m As Map=xtgglst.Get(idx)
	comm.ShowUrl(comm.getApi(comm.apiIdx.SHOWXTGGDETAIL)&m.GetDefault("id","0"))
End Sub